Skip to content

Fix Gemma image prefill prompt logic and UI#181

Merged
kirklandsign merged 5 commits into
mainfrom
gemma
Jan 27, 2026
Merged

Fix Gemma image prefill prompt logic and UI#181
kirklandsign merged 5 commits into
mainfrom
gemma

Conversation

@kirklandsign
Copy link
Copy Markdown
Contributor

@kirklandsign kirklandsign commented Jan 27, 2026

Fixes: #179

@kirklandsign kirklandsign marked this pull request as ready for review January 27, 2026 02:53
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 27, 2026
@kirklandsign kirklandsign requested a review from Copilot January 27, 2026 02:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes the Gemma image prefill prompt logic and updates related UI messages. The changes ensure proper sequencing of settings updates and implement the correct prompt format for Gemma's multimodal capabilities.

Changes:

  • Fixed settings update logic to update currentSettingsFields before calling setBackendMode, ensuring media capabilities are determined with the correct model type
  • Added Gemma-specific prompt formatting methods for multimodal input (pre-image, post-image, and user prompts)
  • Updated UI messages to be more generic and consistent (removed model-specific prefixes)
  • Implemented proper Gemma multimodal prompt flow with prefill calls before and after image data

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ChatViewModel.kt Fixed settings update sequencing, added Gemma image prefill logic with proper prompt calls, updated UI messages, and added conditional logic for Gemma multimodal user prompts
PromptFormat.kt Added three new methods for Gemma multimodal prompt formatting: pre-image, post-image, and multimodal user prompts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kirklandsign kirklandsign merged commit 060c597 into main Jan 27, 2026
8 checks passed
@kirklandsign kirklandsign deleted the gemma branch January 27, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image prefill is not working as expected if image is attached in the first messgae

3 participants